from sqlalchemy import Column, Integer,VARCHAR,DateTime,Enum
from educate_ai.database import Base, engine
import datetime



class User(Base):
    __tablename__ = 'users'
    id = Column(Integer, primary_key=True, autoincrement=True, comment='用户ID')
    username = Column(VARCHAR(100), unique=True, nullable=False, comment='用户名')
    real_name = Column(VARCHAR(100), nullable=True, comment='真实姓名')
    role = Column(Enum('student', 'teacher', 'admin'), default='student', comment='用户角色')
    created_at = Column(DateTime, default=datetime.datetime.now, comment='创建时间')

Base.metadata.create_all(bind=engine)

